#include "VectorUtil.h"
#include <sstream>

namespace kryptos { namespace util {

VectorUtil::VectorUtil()
{
}

std::string VectorUtil::toString(std::vector<unsigned char> vec)
{
    std::string str;
    str.resize(vec.size());
    str.assign(vec.begin(), vec.end());

    return str;
}

std::string VectorUtil::toString(std::vector<char> vec)
{
    return toString(vec);
}


std::list<std::string> VectorUtil::toStringList(std::vector<unsigned char> vec, char delimiter)
{
    std::list<std::string> stringlist;
    std::stringstream ss((char*)vec.data());
    std::string item;
    while(std::getline(ss, item, delimiter))
        stringlist.push_back(item);

    return stringlist;
}

std::list<std::string> VectorUtil::toStringList(std::vector<char> vec, char delimiter)
{
    return std::list<std::string>();
}

}}
